#include "gtest/gtest.h"

#include "ui/poststyle.h"

class TestPostStyle : public ::testing::Test
{
protected:
};

TEST_F(TestPostStyle, CSSParsing)
{
	QString style =
		"html, body { \
		background-color: #EEEEEE; \
		color: #333333; \
		font-family: \"Trebuchet MS\",Trebuchet,tahoma,serif; \
		} \
	a { \
		color: #FF6600 !important; \
	} \
	a:hover { \
	color: #0066FF; \
	} \
	.reply { \
	background:#DDDDDD; \
	border: solid 1px #CCCCCC; \
	} \
	";

	PostStyle s;
	s.loadStyle(style);
	ASSERT_TRUE(QColor(0xee, 0xee, 0xee) == s.backgroundColor());
	ASSERT_TRUE(s.linkColor() == QColor(0xff, 0x66, 0x00));
	ASSERT_TRUE(s.linkHoverColor() == QColor(0x00, 0x66, 0xff));
	ASSERT_TRUE(s.postBackgroundColor() == QColor(0xdd, 0xdd, 0xdd));
}
